﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <p>Input some number and press reverse to get digits backwards</p>
    <input type="text" id="digit-tb" />
    <button id="btn" onclick="reverseDigits(document.getElementById('digit-tb').value)">Reverse</button>
    <div id="js-console"></div>
    <script src="../scripts/js-console.js"></script>
    <script>
        function reverseDigits(number) {
            for (var i = number.length - 1; i >= 0; i--) {
                jsConsole.write(number[i]);
            }
            jsConsole.writeLine();
        }
    </script>
</body>
</html>
